import React from 'react'
import {useState,useEffect} from "react"
import Bus from "../utils/events"
function Bottom(props) {
  console.log(props);
  let [index,setindex] = useState(0)
  useEffect(()=>{
      Bus.addListener("send",(data)=>{
            setindex(data)
      })
  },[])
  return (
    <div>
        {
            props.arr && props.arr.length?<div>
                {
                      props.arr[index].info.map((ite,ind)=>{
                          return <div key={ind}>
                              <img src={ite.img} alt="" />
                              <h4>{ite.tit}</h4>
                          </div>
                      })
                }
               
            </div>:"暂无数据"
        }
    </div>
  )
}
Bottom.defaultProps = {
    color: 'blue'
  };
export default Bottom